grammar Expression;

expression :
    |
    |IDENTIFIER
    |INT
    |DOUBLE
    |stringliteral
    |functioncall
    |arrayvisiting
    |'('expression')'
    |negative
    |expression multiplydivideop expression
    |expression plusminusop expression
    |expression comparisonop expression
    |'!'expression
    |expression logicop expression
    ;

functioncall : IDENTIFIER'('arguments')';
arrayvisiting : IDENTIFIER'['INT']'+;
negative:'-'expression;
multiplydivideop:'*'|'/';
plusminusop:'+'|'-';
comparisonop:'>'|'>='|'<'|'<='|'=';
logicop:'&&'|'||';

//arithmetic: expression multiplydivideop expression
//            |expression plusminusop expression;
//comparison: expression comparisonop expression;

arguments :
    |expression(','expression)*;
stringliteral : '"'.*'"' | '\''.*'\'';
IDENTIFIER  :[a-zA-Z_][a-zA-Z_0-9]* ;
INT:[0-9]+ ;
DOUBLE:INT'.'INT;
SPACE:[ \t\r\n]+ -> skip ;